//
//  isconnectNet.m
//  XM_BProject_Car home
//
//  Created by WLD on 15/12/4.
//
//

#import "isConnectNet.h"
#import "Reachability.h"
@implementation isconnectNet

@end

// 判断网络是否连接方法
BOOL isConnectionAvailable()
{
    BOOL isExistenceNetwork = YES;
    
    Reachability *reach = [Reachability reachabilityWithHostName:@"www.apple.com"];
    
    switch ([reach currentReachabilityStatus]) {
            
        case NotReachable:
            isExistenceNetwork = NO;
            break;
            
        case ReachableViaWiFi:
            isExistenceNetwork = YES;
            break;
            
        case ReachableViaWWAN:
            isExistenceNetwork = YES;
            break;
        default:
            break;
    }
    
    return isExistenceNetwork;
}

